<script type="text/html" id="{$toolbar}">
    <div class="builder-right-buttons layui-btn-container">
        {foreach name="right_buttons" key="key" item="button"}
            <?php if($button['scriptletOpen'] && $button['scriptletClose']){ ?>

            <?php  echo $button['scriptletOpen'];?>

                <button type="button"
                        class="layui-btn layui-btn-sm <?php echo $button['class'] ? 'layui-btn-' . $button['class'] :''; ?>"
                        lay-options="{$button.name}"
                        lay-event="{$button.event}"><?php echo $button['title'];?></button>

            <?php echo $button['scriptletClose'];?>
            <?php }else{ ?>
            <button type="button"
                    class="layui-btn layui-btn-sm <?php echo $button['class'] ? 'layui-btn-' . $button['class'] :''; ?>"
                    lay-options="{$button.name}"
                    lay-event="{$button.event}"><?php echo $button['title'];?></button>
            <?php };?>
        {/foreach}
    </div>
</script>
